<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>清除浮动</title>
    <style>
        /* .clearfix:after {
            content: "";
            display: block;
            height: 0;
            visibility: hidden;
            clear: both;
        } */

        .clearfix::after,
        .clearfix::before {
            /* content: "";
            display: table; */
            box-sizing: inherit;
            outline: 0;
        }
        .clearfix::after {
            clear: both;
        }

        .clearfix {
            *zoom: 1;
        }

        .father {
            width: 500px;
            background-color: pink;
            /* overflow: hidden; */
        }

        .damao {
            float: left;
            width: 200px;
            height: 200px;
            background-color: purple;
        }

        .ermao {
            float: left;
            width: 250px;
            height: 250px;
            background-color: skyblue;
        }

        .one {
            width: 500px;
            height: 200px;
            background-color: black;
        }

        /* .kon {
            clear: both;
        } */
    </style>
</head>
<body>
    <div class="father clearfix">
        <div class="damao"></div>
        <div class="ermao"></div>
        <!-- 1. 隔墙法 -->
        <!-- <div class="kon"></div> -->
    </div>
    <div class="one"></div>
</body>
</html>